package com;



import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class QuickFunctionServlet
 */
@WebServlet("/QuickFunctionServlet")
public class QuickFunctionServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public QuickFunctionServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	
		String value1=request.getParameter("vouchertype");
		
		
			
		if(value1.equals("Sales Voucher"))
		{
			
			request.setAttribute("vtype",value1);
	        RequestDispatcher requestDispatcher; 
	        requestDispatcher = request.getRequestDispatcher("SalesVoucher.jsp" ) ;
	        requestDispatcher.forward(request,response);
		}
		else if(value1.equals("Purchase Voucher"))
		{
			
			request.setAttribute("vtype",value1);
	        RequestDispatcher requestDispatcher; 
	        requestDispatcher = request.getRequestDispatcher("PurchaseVoucher.jsp" ) ;
	        requestDispatcher.forward(request,response);
		}
		else if(value1.equals("Receipt"))
		{
			
			request.setAttribute("vtype",value1);
	        RequestDispatcher requestDispatcher; 
	        requestDispatcher = request.getRequestDispatcher("ReceiptsVoucher.jsp" ) ;
	        requestDispatcher.forward(request,response);
		}
		else if(value1.equals("Payment"))
		{
			
			request.setAttribute("vtype",value1);
	        RequestDispatcher requestDispatcher; 
	        requestDispatcher = request.getRequestDispatcher("PaymentVoucher.jsp" ) ;
	        requestDispatcher.forward(request,response);
		}
	
		else if(value1.equals("Contra"))
		{
			
			request.setAttribute("vtype",value1);
	        RequestDispatcher requestDispatcher; 
	        requestDispatcher = request.getRequestDispatcher("Contra.jsp" ) ;
	        requestDispatcher.forward(request,response);
		}
		else if(value1.equals("Journal"))
		{
			
			request.setAttribute("vtype",value1);
	        RequestDispatcher requestDispatcher; 
	        requestDispatcher = request.getRequestDispatcher("JournalVoucher.jsp" ) ;
	        requestDispatcher.forward(request,response);
		}
		else if(value1.equals("Customer Master"))
		{
			
			request.setAttribute("vtype",value1);
	        RequestDispatcher requestDispatcher; 
	        requestDispatcher = request.getRequestDispatcher("CustomerMaster.jsp" ) ;
	        requestDispatcher.forward(request,response);
		}
		else if(value1.equals("Supplier Master"))
		{
			
			request.setAttribute("vtype",value1);
	        RequestDispatcher requestDispatcher; 
	        requestDispatcher = request.getRequestDispatcher("SupplierMaster.jsp" ) ;
	        requestDispatcher.forward(request,response);
		}
		else if(value1.equals("Bank Master"))
		{
			
			request.setAttribute("vtype",value1);
	        RequestDispatcher requestDispatcher; 
	        requestDispatcher = request.getRequestDispatcher("BankMaster.jsp" ) ;
	        requestDispatcher.forward(request,response);
		}
		else if(value1.equals("General Ledger Master"))
		{
			
			request.setAttribute("vtype",value1);
	        RequestDispatcher requestDispatcher; 
	        requestDispatcher = request.getRequestDispatcher("GeneralLedger.jsp" ) ;
	        requestDispatcher.forward(request,response);
		}
		else if(value1.equals("Balance Sheet"))
		{
			
			request.setAttribute("vtype",value1);
	        RequestDispatcher requestDispatcher; 
	        requestDispatcher = request.getRequestDispatcher("Balancesheet2.jsp" ) ;
	        requestDispatcher.forward(request,response);
		}
		else if(value1.equals("Profit And Loss Account"))
		{
			
			request.setAttribute("vtype",value1);
	        RequestDispatcher requestDispatcher; 
	        requestDispatcher = request.getRequestDispatcher("ProfitAndLossAccount2.jsp" ) ;
	        requestDispatcher.forward(request,response);
		}
		else if(value1.equals("Cash Flow Statement"))
		{
			
			request.setAttribute("vtype",value1);
	        RequestDispatcher requestDispatcher; 
	        requestDispatcher = request.getRequestDispatcher("CashFlow.jsp" ) ;
	        requestDispatcher.forward(request,response);
		}
		else if(value1.equals("Trial Balance"))
		{
			
			request.setAttribute("vtype",value1);
	        RequestDispatcher requestDispatcher; 
	        requestDispatcher = request.getRequestDispatcher("TrialBalance.jsp" ) ;
	        requestDispatcher.forward(request,response);
		}
	
	}
	

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

}
